﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib">


    <Storyboard x:Key="InitEditViewContainerState">

        <!-- Hide view container (invisibility enabled "clicking through" to underlying view) -->

        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="Visibility">
            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Hidden</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>


        <!-- Display list of items already added to order -->
        <DoubleAnimation Storyboard.TargetName="OrderItemListBorder" Storyboard.TargetProperty="(UIElement.Opacity)" To="1" />

        <!-- Display column of product images -->
        <DoubleAnimation Storyboard.TargetName="gridImageTriggers" Storyboard.TargetProperty="(UIElement.Opacity)" To="1" />


        <!-- Hide OK/Canel button -->

        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="buttonPanel" Storyboard.TargetProperty="Visibility">
            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Collapsed</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>

    </Storyboard>
    

    <Storyboard x:Key="DisplayEditViewContainer">
        
        <!-- Make view container visible (invisibility enabled "clicking through" to underlying view) -->

        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="Visibility">
            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Visible</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
        
        <!-- Edit view "zoom in" animation effect -->
        
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.025"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.15" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.025"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.15" Value="1" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.334"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.15" Value="0" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-18.5"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.15" Value="0" />
        </DoubleAnimationUsingKeyFrames>
        
        <!-- Hide list of items already added to order -->
        
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="OrderItemListBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.15" Value="0"/>
        </DoubleAnimationUsingKeyFrames>
        
        <!-- Hide column of product images -->
        
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="gridImageTriggers" Storyboard.TargetProperty="(UIElement.Opacity)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.15" Value="0"/>
        </DoubleAnimationUsingKeyFrames>
        

        <!-- Display OK/Canel button -->

        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="buttonPanel" Storyboard.TargetProperty="Visibility">
            <DiscreteObjectKeyFrame KeyTime="00:00:00.15">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Visible</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>

    </Storyboard>
    
    
    <Storyboard x:Key="HideEditViewContainer">

        <!-- Edit view "fly out" animation effect -->

        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="-0.02"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="0.02"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="264"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="-325"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
            <SplineDoubleKeyFrame KeyTime="00:00:00.5" Value="720"/>
        </DoubleAnimationUsingKeyFrames>
        
        <!-- Hide view container (invisibility enabled "clicking through" to underlying view) -->

        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EditItemViewContainer" Storyboard.TargetProperty="Visibility">
            <DiscreteObjectKeyFrame KeyTime="00:00:00.5">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Hidden</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
        
        
        <!-- Display list of items already added to order -->
        <DoubleAnimation Storyboard.TargetName="OrderItemListBorder" Storyboard.TargetProperty="(UIElement.Opacity)" To="1" BeginTime="00:00:00.15" Duration="00:00:00.25" />

        <!-- Display column of product images -->
        <DoubleAnimation Storyboard.TargetName="gridImageTriggers" Storyboard.TargetProperty="(UIElement.Opacity)" To="1" BeginTime="00:00:00.15" Duration="00:00:00.25" />


        <!-- Hide OK/Canel button -->

        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="buttonPanel" Storyboard.TargetProperty="Visibility">
            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Collapsed</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>

    </Storyboard>


</ResourceDictionary>